 {extend name="extra@admin/content"}
{block name="content"}
<form class="layui-form layui-box" style='padding:25px 30px 20px 0' action="__SELF__" data-auto="true" method="post">

    <div class="layui-form-item">
        <label class="layui-form-label">门店名称</label>
        <div class="layui-input-block">
            {if $vo and isset($vo.title)}
            <input name="title" value='{$vo.title|default=""}'
                   required="required" title="请输入门店名称" placeholder="请输入门店名称" class="layui-input ">
            {else}
            <input name="title" value='{$vo.title|default=""}' required="required" 
                   title="请输入门店名称" class="layui-input">
            {/if}
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">门店地址</label>
        <div class="layui-input-block">
            {if $vo and isset($vo.address)}
            <input name="address" value='{$vo.address|default=""}'
                   required="required" title="请输入门店地址" placeholder="请输入门店地址" class="layui-input ">
            {else}
            <input name="address" value='{$vo.address|default=""}' required="required"
                   title="请输入门店地址" class="layui-input">
            {/if}
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">联系电话</label>
        <div class="layui-input-block">
            <input name="mobile" value='{$vo.mobile|default=""}'
                   required="required" title="请输入联系电话" placeholder="请输入联系电话" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">达达编号</label>
        <div class="layui-input-block">
            <input name="dada" value='{$vo.dada|default=""}'
                   required="required" title="请输入达达编号" placeholder="请输入达达编号" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">营业时间</label>
            <!--<div class="layui-form-mid">期限</div>-->
            <div class="layui-input-inline">
                <input type="text" name="business_time_start" class="layui-input" id="business_time_start" placeholder="" value="{$vo.business_time_start|default=''}" required>
            </div>
            <div class="layui-input-inline">
                <input type="text" name="business_time_end" class="layui-input" id="business_time_end" placeholder="" value="{$vo.business_time_end|default=''}" required>
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">所属城市</label>
        <div class="layui-input-block">
            <select name="city_key" lay-verify="required" lay-filter="test" lay-search >
                <option value="">请选择所属城市</option>
                {volist name='city' id='v'}
                <option value="{$v.key}" {if condition="$vo['city_key'] eq $v['key']"} selected {/if}>{$v.value}</option>
                {/volist}
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">门店类型</label>
        <div class="layui-input-block">
          <input type="radio" lay-filter="test" name="is_jiameng" value="1"  title="加盟店" {if condition="!empty($vo.is_jiameng)"} checked {/if}>
          <input type="radio" lay-filter="test" name="is_jiameng" value="0"  title="直营店" {if condition="empty($vo.is_jiameng)"} checked {/if}>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">允许调价</label>
        <div class="layui-input-block">
          <input type="radio" lay-filter="test" name="price_status" value="1"  title="是" {if condition="!empty($vo.price_status)"} checked {/if}>
          <input type="radio" lay-filter="test" name="price_status" value="0"  title="否" {if condition="empty($vo.price_status)"} checked {/if}>
        </div>
    </div>
    <!--<div class="layui-form-item">-->
        <!--<label class="layui-form-label">上传图片</label>-->
            <!--<div class="uploadimage"><input type="hidden" name="logo" {if $vo and isset($vo.logo)} value="{$vo.logo}" {/if}/></div>-->
            <!--<a data-file="one" data-field="logo" data-type="png,jpg" data-uptype="qiniu" href="javascript:void(0)"-->
               <!--class="uploadbutton">上传图片</a>-->
            <!--<script>-->
                <!--$(function(){-->
                	<!--var img = "{$vo.logo}";-->
				<!--　　require(['jquery'], function () {-->
	                   <!--$('[name="logo"]').parent().attr('data-tips-image', this.value).css('backgroundImage', 'url(' + img + ')');-->
	                <!--});-->
					<!--require(['jquery'], function () {-->
                    	<!--var tpl = '<div class="uploadimage transition uploadimagemtl"><a href="javascript:void(0)" class="layui-icon upload-option-button">&#x1006;</a></div>';-->
                    	<!--var input = this, values = "{$vo.images}", srcs = this.value.split('|');-->
                        <!--for (var i in values) {-->
                            <!--var $tpl = $(tpl).attr('data-tips-image', values[i]).css('backgroundImage', 'url(' + values[i] + ')');-->
                            <!--$tpl.data('input', input).data('srcs', values).data('index', i);-->
                            <!--$tpl.on('click', 'a', function (e) {-->
                                <!--e.stopPropagation();-->
                                <!--var $cur = $(this).parent();-->
                                <!--$.msg.confirm('确定要移除这张图片吗？', function () {-->
                                    <!--var data = $cur.data('srcs');-->
                                    <!--delete data[$cur.data('index')];-->
                                    <!--$cur.data('input').value = data.join('|');-->
                                    <!--$cur.remove();-->
                                <!--});-->
                            <!--});-->
                            <!--$(this).before($tpl);-->
                        <!--}-->
                    <!--});-->
	            <!--});-->
            <!--</script>-->
            <!--<script>-->
                <!--require(['jquery'], function () {-->
                    <!--$('[name="logo"]').on('change', function () {-->
                        <!--$(this).parent().attr('data-tips-image', this.value).css('backgroundImage', 'url(' + this.value + ')');-->
                    <!--});-->
                <!--});-->
            <!--</script>-->
    <!--</div>-->
    <!--<div class="layui-form-item">-->
        <!--<label class="layui-form-label">上传图片</label>-->
            <!--<style>-->
                <!--.upload-option-button {-->
                    <!--float: right;-->
                    <!--background: rgba(0, 0, 0, 0.5);-->
                    <!--color: #fff;-->
                    <!--width: 20px;-->
                    <!--height: 20px;-->
                    <!--line-height: 20px;-->
                    <!--text-align: center;-->
                    <!--display: none-->
                <!--}-->

                <!--.upload-option-button:hover {-->
                    <!--text-decoration: none;-->
                    <!--color: #fff-->
                <!--}-->

                <!--.uploadimagemtl:hover a {-->
                    <!--display: inline-block-->
                <!--}-->
            <!--</style>-->
            <!--<input type='hidden' name='images' value="{if condition='!empty($vo.images)'} {$vo.images} {/if}"/>-->
            <!--<a data-file="mut" data-field="images" data-type="png,jpg" data-uptype="qiniu" href="javascript:void(0)">上传图片</a>-->
            <!--<script type="text/javascript">-->
                <!--require(['jquery'], function () {-->
                    <!--var tpl = '<div class="uploadimage transition uploadimagemtl"><a href="javascript:void(0)" class="layui-icon upload-option-button">&#x1006;</a></div>';-->
                    <!--$('[name="images"]').on('change', function () {-->
                        <!--var input = this, values = [], srcs = this.value.split('|');-->
                        <!--$(this).prevAll('.uploadimage').map(function () {-->
                            <!--values.push($(this).attr('data-tips-image'));-->
                        <!--}), $(this).prevAll('.uploadimage').remove();-->
                        <!--values.reverse();-->
                        <!--for (var i in srcs) {-->
                            <!--values.push(srcs[i]);-->
                        <!--}-->
                        <!--this.value = values.join('|');-->
                        <!--for (var i in values) {-->
                            <!--var $tpl = $(tpl).attr('data-tips-image', values[i]).css('backgroundImage', 'url(' + values[i] + ')');-->
                            <!--$tpl.data('input', input).data('srcs', values).data('index', i);-->
                            <!--$tpl.on('click', 'a', function (e) {-->
                                <!--e.stopPropagation();-->
                                <!--var $cur = $(this).parent();-->
                                <!--$.msg.confirm('确定要移除这张图片吗？', function () {-->
                                    <!--var data = $cur.data('srcs');-->
                                    <!--delete data[$cur.data('index')];-->
                                    <!--$cur.data('input').value = data.join('|');-->
                                    <!--$cur.remove();-->
                                <!--});-->
                            <!--});-->
                            <!--$(this).before($tpl);-->
                        <!--}-->
                    <!--});-->
                <!--});-->
            <!--</script>-->
    <!--</div>-->
    <!--<div class="layui-form-item">-->
        <!--<label class="layui-form-label">门店简介</label>-->
        <!--<div class="layui-input-block">-->
            <!--<textarea placeholder="请输入门店简介不超过100个字符" maxlength="100" title="请输入门店简介" class="layui-textarea" name="description"></textarea>-->
        <!--</div>-->
    <!--</div>-->
    <!--<div class="layui-form-item">-->
        <!--<label class="layui-form-label">门店详情</label>-->
        <!--<div class="layui-input-block">-->
            <!--<textarea name="detail">{$vo.detail}</textarea>-->
            <!--<script type="text/javascript">-->
            <!--require(['ckeditor'], function () {-->
                <!--var editor = window.createEditor('[name="detail"]');-->
                <!--// 设置内容-->
<!--//                editor.setData('修改内容');-->
                <!--// 获取内容-->
<!--//                var content = editor.getData();-->
<!--//                console.log(content);-->
            <!--});-->
            <!--</script>-->
            <!--<script>-->
                <!--layui.use('code', function () {-->
                    <!--layui.code({encode: true});-->
                <!--});-->
            <!--</script>-->
        <!--</div>-->
    <!--</div>-->
    <div class="hr-line-dashed"></div>
    <div class="layui-form-item text-center">
        {if isset($vo['id'])}<input type='hidden' value='{$vo.id}' name='id'/>{/if}
        <button class="layui-btn" type='submit'>保存数据</button>
        <a href="javascript:history.back(-1)" class="layui-btn layui-btn-danger">返回</a>
        <!--<button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗？" data-close>取消编辑</button>-->
    </div>
    <script>
        window.form.render();
        //时间选择器
        laydate.render({
            elem: '#business_time_start'
            ,type: 'time'
        });
        laydate.render({
            elem: '#business_time_end'
            ,type: 'time'
        });
    </script>
</form>
{/block}
